package siestageek.exam;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

public class EX02_AccountDAO 
		implements EX02_IAccountDAO {

	private String DRV = "";
	private String URL = "";
	private String insertSQL = " insert into Account values ( ?,?,?, sysdate ) ";     
	private String selectSQL = "";
	private String updateSQL = "";
	private String deleteSQL = "";
	
	@Override
	public boolean insertAccount(EX02_AccountVO avo) {
		Connection conn = null;
		PreparedStatement pstmt = null;
		boolean result = false;
		
		try {
			conn = openDatabase();
			pstmt = conn.prepareStatement(insertSQL);
				pstmt.setString( 1, avo.getAid() );
				pstmt.setString( 2, avo.getBalance() );
				pstmt.setString( 3, avo.getInterestRate() );
			pstmt.executeUpdate();
			result = true;
		} catch (Exception ex) {
			ex.printStackTrace();
		} finally {
			closeDatabase(conn, pstmt, null);
		}
		
		
		return result;
	}
	
	private Connection openDatabase() {
		return null;
	}
	
	private void closeDatabase( Connection c,
			PreparedStatement p, ResultSet r) {
		
	}
	
	
}




